load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "storage",
    srcs = [
        "array_32bit.go",
        "array_64bit.go",
        "ballast.go",
        "batch.go",
        "col_mvcc.go",
        "disk_map.go",
        "doc.go",
        "engine.go",
        "engine_key.go",
        "engine_key_fuzz.go",
        "fingerprint_writer.go",
        "in_mem.go",
        "intent_interleaving_iter.go",
        "lock_table_iterator.go",
        "lock_table_key_scanner.go",
        "min_version.go",
        "mvcc.go",
        "mvcc_incremental_iterator.go",
        "mvcc_key.go",
        "mvcc_logical_ops.go",
        "mvcc_value.go",
        "open.go",
        "pebble.go",
        "pebble_batch.go",
        "pebble_iterator.go",
        "pebble_logger_and_tracer.go",
        "pebble_merge.go",
        "pebble_mvcc_scanner.go",
        "read_as_of_iterator.go",
        "replicas_storage.go",
        "row_counter.go",
        "shared_storage.go",
        "slice.go",
        "slice_go1.9.go",
        "sst.go",
        "sst_writer.go",
        "store_properties.go",
        "temp_engine.go",
        "verifying_iterator.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/storage",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/build",
        "//pkg/cloud",
        "//pkg/clusterversion",
        "//pkg/col/coldata",
        "//pkg/keys",
        "//pkg/kv/kvnemesis/kvnemesisutil",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/diskmap",
        "//pkg/kv/kvserver/uncertainty",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/storage/disk",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/storage/pebbleiter",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/bufalloc",
        "//pkg/util/buildutil",
        "//pkg/util/encoding",
        "//pkg/util/envutil",
        "//pkg/util/grpcutil",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/log/eventpb",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/syncutil",
        "//pkg/util/sysutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_fifo//:fifo",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_pebble//:pebble",
        "@com_github_cockroachdb_pebble//batchrepr",
        "@com_github_cockroachdb_pebble//bloom",
        "@com_github_cockroachdb_pebble//objstorage",
        "@com_github_cockroachdb_pebble//objstorage/objstorageprovider",
        "@com_github_cockroachdb_pebble//objstorage/remote",
        "@com_github_cockroachdb_pebble//rangekey",
        "@com_github_cockroachdb_pebble//replay",
        "@com_github_cockroachdb_pebble//sstable",
        "@com_github_cockroachdb_pebble//sstable/block",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_pebble//wal",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_cockroachdb_redact//interfaces",
        "@com_github_dustin_go_humanize//:go-humanize",
        "@com_github_elastic_gosigar//:gosigar",
        "@com_github_gogo_protobuf//proto",
        "@com_github_prometheus_client_model//go",
    ],
)

go_test(
    name = "storage_test",
    size = "medium",
    srcs = [
        "ballast_test.go",
        "batch_test.go",
        "bench_cloud_io_test.go",
        "bench_data_test.go",
        "bench_pebble_test.go",
        "bench_test.go",
        "disk_map_test.go",
        "engine_key_test.go",
        "engine_test.go",
        "external_helpers_test.go",
        "intent_interleaving_iter_test.go",
        "lock_table_iterator_test.go",
        "main_test.go",
        "min_version_test.go",
        "mvcc_history_metamorphic_iterator_test.go",
        "mvcc_history_test.go",
        "mvcc_incremental_iterator_test.go",
        "mvcc_key_test.go",
        "mvcc_logical_ops_test.go",
        "mvcc_stats_test.go",
        "mvcc_test.go",
        "mvcc_value_test.go",
        "open_test.go",
        "pebble_iterator_test.go",
        "pebble_mvcc_scanner_test.go",
        "pebble_test.go",
        "read_as_of_iterator_test.go",
        "sst_test.go",
        "sst_writer_test.go",
        "temp_engine_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":storage"],
    exec_properties = {"test.Pool": "large"},
    shard_count = 4,
    deps = [
        "//pkg/base",
        "//pkg/cloud",
        "//pkg/cloud/amazon",
        "//pkg/cloud/gcp",
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/diskmap",
        "//pkg/kv/kvserver/spanset",
        "//pkg/kv/kvserver/uncertainty",
        "//pkg/roachpb",
        "//pkg/security/username",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/tree",
        "//pkg/storage/disk",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/echotest",
        "//pkg/testutils/skip",
        "//pkg/testutils/testfixtures",
        "//pkg/testutils/zerofields",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/encoding",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/iterutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/shuffle",
        "//pkg/util/sysutil",
        "//pkg/util/timeutil",
        "//pkg/util/uint128",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//:pebble",
        "@com_github_cockroachdb_pebble//objstorage",
        "@com_github_cockroachdb_pebble//objstorage/objstorageprovider",
        "@com_github_cockroachdb_pebble//sstable",
        "@com_github_cockroachdb_pebble//sstable/block",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_kr_pretty//:pretty",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_protobuf//proto",
        "@org_golang_x_sync//errgroup",
    ],
)
